<?php

/*
 * File  : menu.php
 * Table : moduls
 */

session_start();
//cek session

if ((!$_SESSION["USRID"] AND !$_SESSION["USRPASS"])) {
    header("location: index.php");
    exit();
}
//end
?>

<?php

if ($_SESSION["USRLEVEL"] == "admin") {
    $sql = mysql_query("select mod_nama, mod_link from moduls where mod_aktif='Y' order by mod_urutan");
} else {
   $sql = mysql_query("select mod_nama, mod_link from moduls where mod_aktif='Y' order by mod_urutan");
}
 
echo " <ul>";
echo "  <li><a href=?module=home>Home</a></li>";

while ($m = mysql_fetch_array($sql)) {
    echo "<li><a href='" . $m["mod_link"] . "' >" . $m["mod_nama"] . "</a></li>";
}
echo "  <li><a href=logout.php>Logout</a></li>";
echo " </ul>";
?>
